package com.example.demo.exception;

import com.baomidou.mybatisplus.extension.api.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @DESCRIPTION:
 * @AUTOOR: Lee
 * @DATE: 2022年09月18日 2:37
 */
@RestControllerAdvice
//@ResponseBody
public class ApiExceptionHandler {

    @ExceptionHandler(ServiceException.class)
    public R exceptionHandler(ServiceException e) {
        return R.failed(e.getMessage());
    }
}
